% author : Lei Yinghaonan
% Creation Date : 2021.11.26
% Last Date : 2021.11.28
% brief : change ascii to string of boundary condition name.

function BCNameStr = InitBCName(BCNameASCII)
% BCNameASCII : A list of ASCII;
% BCNameStr : A strings array of bc name.

% ---change ASCII to char---
% Note here,the last of BCNameChar is " ".
BCNameChar = char(BCNameASCII)';

% ---find char(0)---
charID = (1:length(BCNameChar))';
log = BCNameChar == char(0);
char0ID = charID(log);
nBCName = length(char0ID);
char0ID = [0;char0ID];
BCNameStr = strings(nBCName,1);

% ---change char to string---
for iBCName = 1:nBCName
    BCNameStr(iBCName) = ...
        string(...
        BCNameChar(char0ID(iBCName)+1:char0ID(iBCName+1)-1)...
        );
end


